package com.itheima.search.controller;

import com.itheima.search.domain.NewsVO;
import com.itheima.search.service.ISearchService;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 16701
 */
@RestController
@RequestMapping("/search")
public class SearchController {
    @Autowired
    private ISearchService searchService;
    @GetMapping("/{newsId}")
    public NewsVO getNewsById(@PathVariable("newsId") Long newsId){
        return searchService.getNewsById(newsId);
    }
}
